using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using DomainLayer.Data.Entities;

namespace Infrastructure.Data.Mapping
{
	public class GPSOrderStatuMap : EntityTypeConfiguration<GPSOrderStatu>
	{
		public GPSOrderStatuMap()
		{
			// Primary Key
			this.HasKey(t => t.id);

			// Properties
			this.Property(t => t.orderno)
				.HasMaxLength(32);
				
			this.Property(t => t.statestr)
				.HasMaxLength(50);
				
			this.Property(t => t.distributor)
				.HasMaxLength(20);
				
			this.Property(t => t.distphone)
				.HasMaxLength(20);
				
			this.Property(t => t.gpsid)
				.HasMaxLength(16);
				
			this.Property(t => t.truckno)
				.IsFixedLength()
				.HasMaxLength(16);
				
			this.Property(t => t.station)
				.HasMaxLength(10);
				
			// Table & Column Mappings
			this.ToTable("GPSOrderStatus");
			this.Property(t => t.id).HasColumnName("id");
			this.Property(t => t.orderno).HasColumnName("orderno");
			this.Property(t => t.status).HasColumnName("status");
			this.Property(t => t.statestr).HasColumnName("statestr");
			this.Property(t => t.distributor).HasColumnName("distributor");
			this.Property(t => t.distphone).HasColumnName("distphone");
			this.Property(t => t.time).HasColumnName("time");
			this.Property(t => t.createtime).HasColumnName("createtime");
			this.Property(t => t.gpsid).HasColumnName("gpsid");
			this.Property(t => t.truckno).HasColumnName("truckno");
			this.Property(t => t.isSyn).HasColumnName("isSyn");
			this.Property(t => t.station).HasColumnName("station");
		}
	}
}

